package net.esj.basic.config;

import net.esj.basic.utils.ApplicationBeanContext;

import org.springframework.beans.factory.annotation.Value;

//@Component
//@Scope("singleton")
public class Config {

	@Value("${file.upload.path}")
	private String fileUploadPath;
	
	@Value("${file.download.url}")
	private String fileDownloadUrl;
	
	@Value("${img.upload.path}")
	private String imgUploadPath;
	
	@Value("${img.download.url}")
	private String imgDownloadUrl;
	
	@Value("${has.ngix}")
	private boolean ngix;
	
	private static Config instance(){
		return (Config) ApplicationBeanContext.getBean("config");
	}

	public static String getFileUploadPath() {
		return instance().fileUploadPath;
	}

	public static String getFileDownloadUrl() {
		return instance().fileDownloadUrl;
	}

	public static String getImgUploadPath() {
		return instance().imgUploadPath;
	}

	public static String getImgDownloadUrl() {
		return instance().imgDownloadUrl;
	}

	public static boolean hasNgix(){
		return instance().ngix;
	}
}
